Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tried to close last window error #309

Merged
merged 2 commits into from
Jun 27, 2024
Merged

Fix tried to close last window error #309

merged 2 commits into from
Jun 27, 2024

Conversation

cameronr
Copy link
Collaborator

Easiest repro is only have a new buffer (not saved to a file) and exit. We'll try to close that window and generate an error.

To fix, we wrap Lib.close_unsupported_windows in a pcall. In general, not great to eat all errors but we're making our best effort to close all of the unsupported windows and there are a bunch of edge cases there so this seems like the most reasonable path to me.

Also added a missiing local

cameronr added 2 commits June 24, 2024 16:46
Easiest repro is only have a new buffer (not saved to a file) and exit.
We'll  try to close that window and generate an error.

To fix, we wrap `Lib.close_unsupported_windows` in a `pcall`. In
general, not great to eat all errors but we're making our best effort to
close all of the unsupported windows and there are a bunch of edge cases
there so this seems like the most reasonable path to me.

Also added a missiing local
If we do close a window in a tab, keep checking other windows in that
tab (that's why the `break` was removed).

Log an error (debug level) if `close_unsupported_windows` fails. Only
useful for debugging (not worth bothering the user about it)
Copy link
Owner

@rmagatti rmagatti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Sorry I hadn't seen this before

@rmagatti rmagatti merged commit 363f9e2 into rmagatti:main Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants